


#ifndef UDP_CLIENT_H
#define UDP_CLIENT_H

typedef struct udp_client_info
{
	int fd;
	struct sockaddr_in peerfd;
	//int port;
	//char ip[20];
	struct sockaddr_in server;
}UDP_CLIENT_INFO;

typedef struct udp_client_statiac
{
	int txbytes;
	int rxbytes;
	int txbyteps;
	int rxbyteps;

}UDP_CLIENT_STATIC;
typedef struct udp_client_entry
{
	UDP_CLIENT_INFO udp_client;
	UDP_CLIENT_STATIC stat;
	char phy_name[32];
	int phy_idx; 
	int used;
}UDP_CLIENT_ENTRY;

typedef struct udp_client_mng
{
	UDP_CLIENT_ENTRY udp_entry[128];
	int used_num;
}UDP_CLIENT_MNG;


int udp_get_msg(UDP_CLIENT_ENTRY *udp_entry,uint8_t *buff,int size,int *retsize);
int udp_send_msg(UDP_CLIENT_ENTRY *udp_entry,uint8_t *buff,int size);
UDP_CLIENT_ENTRY *create_udp_client(unsigned char *ip,int port);
//void free_udp_entry(UDP_CLIENT_ENTRY *udp_entry);
UDP_CLIENT_ENTRY *clone_udp_client(int fd,struct sockaddr_in *peerfd);
int clear_udp_client(UDP_CLIENT_ENTRY *udp_entry);
//void free_udp_entry(UDP_CLIENT_ENTRY *udp_entry);
//UDP_CLIENT_ENTRY *new_udp_entry();


#endif


